/**
 * @author LKQ
 * @date 2022/2/20 12:10
 * @description
 */
public class Solution {
    public static void main(String[] args) {
        Solution solution = new Solution();
        solution.dailyTemperatures(new int[]{30, 40, 50 ,60});
    }
    public int[] dailyTemperatures(int[] temperatures) {
        int n = temperatures.length;
        int[] ans = new int[n];
        for (int i = 0; i < n; i++) {
            int cur = temperatures[i], j = i + 1, max = 0;
            for (; j < n; j++) {
                if (temperatures[j] > cur) {
                    max = temperatures[i];
                    break;
                }
            }

            ans[i] = max == 0 ? 0 : j - i;
        }
        return ans;
    }
}
